package com.hengpeng.itfinoss.controller.area;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hengpeng.common.area.AreaCache;
import com.hengpeng.common.area.vo.Area;
import com.hengpeng.itfinoss.controller.BaseController;

@Controller
@RequestMapping("/area/area")
public class AreaController extends BaseController
{
	@RequestMapping(value = "/findArea/{id}")
	@ResponseBody
	public Map<Object, Object> findArea(@PathVariable Long id)
	{
		Map<Object, Object> jsonMap = new HashMap<Object, Object>();
		Area area = AreaCache.getInstance().get(id);
		if (area != null)
		{
			jsonMap.put("list", area.getChildList());
		}
		return jsonMap;
	}
}
